import {get} from "@/utils/http"
export default{
    namespaced: true,
    state:{
        sessionData:undefined,
        teacherData:undefined,
        commandData:[]
    },
    mutations:{
        setSessoinData(state,payload){
            state.sessionData = payload
        },
        setTeacherData(state,payload){
            state.teacherData = payload
        },
        setCommandData(state,payload){
            state.commandData = payload
        }
        
    },
    actions:{
        async getCommand(store,payload){
            let promiseArr = payload.map((id)=>{
                return get("/session/detail/"+id)
            })
            Promise.all(promiseArr).then(arr=>store.commit("setCommandData",arr)).catch(err=>console.log(err))
        }
    },
    getters:{
        
    }
}